home *** CD-ROM | disk | FTP | other *** search
-
- CHECK
- -----
-
- Purpose: For use with batch files, CHECK tests for various conditions and
- reports by setting DOS ErrorLevel.
-
- Format: CHECK parameter [parameter...]
-
- Parameters must be separated with spaces. Some of them require
- parameters of their own. Here is the list:
-
- DAY
-
- Returns day of the month (1-31)
-
- DISKSPACE [d:]
-
- returns the number of whole 16K blocks of free disk space
- from the indicated or default drive. It returns 0 if an
- error is encountered. A return of 255 means that there are
- at least that many blocks free.
-
- FILEFOUND filename
-
- returns 0 if the indicated file is found, 1 if it's not.
-
- FILESIZE filename
-
- returns the length in kilobytes of the specified file. 255
- means the file is 255K or larger. 0 means the file can't be
- found.
-
- FILETEXT filename 'text'
-
- returns 0 if the specified text is found within the indicated
- file. 1 is returned if the file doesn't contain the text, if
- the file can't be found or if there's syntax error.
-
- KEYBOARD
-
- returns 1 if a key has been pressed, 0 if one has not.
-
- KEYPRESS
-
- waits for a keypress (if one hasn't already been pressed) and
- returns its ASCII code.
-
- MEMORY
-
- returns the number of 16K RAM modules present in the system.
-
- MODEL
-
- returns the machine ID byte of the computer being used. For
- IBM machines, 255 means a plain PC, 254 a PC/XT or a port-
- able, 253 a PCjr, 252 a PC/AT, and 249 a PC Convertible.
-
- CHECK Page 2
-
-
- MONTH
-
- returns the current month (1-12)
-
- TIME
-
- returns the current hour of the day (0-23)
-
- VIDEOCARD
-
- returns the current video mode (0-16).
-
- VIDEOMODE
-
- returns a value indicating what kind of video adapter is
- being used. (0=MDA, 1=CGA, 2=EGA)
-
- VERSION
-
- returns the major number of the version of DOS in use.
-
- 8087 or 80287
-
- return 0 if either an 8087 nor an 80287 is present, 1 if not.
-
-
- Remarks: To use CHECK, you run it from a batch file and sort out the re-
- turned value with IF ERRORLEVEL statements. Remember that IF
- ERRORLEVEL n is true if the error level is n or higher.
-
- This program is copyright 1986 by Ziff-Davis Publishing Co. It
- was written by Jeff Prosise and published in "PC Lab Notes," PC
- Magazine, 6/3, Feb. 10, 1987, pp. 299-321.
-
- See that article for detailed discussion of how CHECK works, how
- to use it and how it might be modified.